package com.wangp.springbootsource.event;

/**
 * <pre>
 * classname Test
 * description
 * </pre>
 *
 * @author wangp
 * @date 2020/9/2 22:32
 **/
public class Test {

    //监听器  广播器  事件
    public static void main(String[] args) {
        WeatherEventMulticaster multicaster = new WeatherEventMulticaster();
        RainListener rainListener = new RainListener();
        SnowListener snowListener = new SnowListener();
        multicaster.addListener(rainListener);
        multicaster.addListener(snowListener);
        multicaster.multicast(new SnowEvent());
        multicaster.multicast(new RainEvent());
        multicaster.removeListener(rainListener);
        multicaster.multicast(new SnowEvent());
        multicaster.multicast(new RainEvent());
        
        String json = "";
    }
}
